<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/10/19 0019
 * Time: 下午 8:30
 */
header('content-type:text/html;charset=utf-8');
if (!defined('APP'))die('error');?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>员工信息列表</title>
    <style>
        .top  {position:relative;width:500px;height: 50px;font-size:30px;line-height: 50px;text-align: center;margin:0 auto;}
        table{margin:0 auto;}
        table tr td  {border: 1px solid blue;text-align: center;
            height:30px;margin-left: 5px;}
        table tr th {background-color:gainsboro;height:35px;}
        .biaodan {margin-left: 660px;}
        .fenye {margin-left: 700px;width:250px;margin-top:20px;}
    </style>
</head>
<body>
<div class="top">员工信息列表</div>
<form action="./showList.php" method="get">
    <div class="biaodan">快速查询 <input type="text" name="keyword"/> <input type="submit" value="提交"/></div>
</form>
<table>
    <tr>
        <th>ID</th>
        <th>姓名</th>
        <th><a href="./showList.php?order=e_dept&sort=<?php echo
            ($order='e_dept') ? $sort : 'desc';?>">所属部门</a> </th>
        <th>出生日期</th>
        <th><a href="./showList.php?order=date_of_entry&sort=<?php echo
            ($order='date_of_entry') ? $sort : 'desc';?>">入职时间</a></th>
        <th width="25%">相关操作</th>
    </tr>
    <?php  if (!empty($emp_info)) { ?>
        <?php foreach ($emp_info as $row){ ?>
            <tr>
                <td><?php echo $row['e_id']; ?></td>
                <td><?php echo $row['e_name']; ?></td>
                <td><?php echo $row['e_dept']; ?></td>
                <td><?php echo $row['date_of_birth']; ?></td>
                <td><?php echo $row['date_of_entry']; ?></td>
                <td><div><span>编辑&nbsp;&nbsp;删除</span></div></td>
            </tr>
        <?php } ?>
    <?php }
    else{ ?>
        <tr><td colspan="6" >暂无员工数据！ </td></tr>
    <?php } ?>
</table>
<div class="fenye"><?php echo $page_html;?></div>
</body>
</html>

